#ifndef COMPANYLISTWIDGET_H
#define COMPANYLISTWIDGET_H

#include <QWidget>
#include <QScrollArea>
#include "model/data.h"

class CompanyCard;

namespace Ui {
class CompanyListWidget;
}

class CompanyListWidget : public QWidget
{
    Q_OBJECT

public:
    explicit CompanyListWidget(QWidget *parent = nullptr);
    ~CompanyListWidget();

    void clear();
    void setCardList(const QList<model::CompanyInfo>& companys);

private slots:
    void on_btn_recommend_clicked();

private:
    void init();
    void initStyleSheet();
    void initPanel();
    void initBody();

    void showCompany(const model::CompanyInfo& companyInfo);

    void searchCompanyDone();
private:
    QScrollArea *_scrollArea = nullptr;
    QWidget *_container = nullptr;

private:
    Ui::CompanyListWidget *ui;
};

#endif // COMPANYLISTWIDGET_H
